home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
q4tool.zip
/
Q4TOOL.DOC
< prev
next >
Wrap
Text File
|
1990-08-19
|
39KB
|
891 lines
The Q4Tool Library [Q4T]
Ver. 1.2
Library Routines for QuickBASIC 4.x
by R. J. Crouch - August 1990
Copyright - 1990 - CareWare
All Rights Reserved
_________________________________________
** What is the Q4Tool Library? **
======================================
Q4Tool is a small collection of innovative and direct
programming tools, in the form of a user library, for
Microsoft (R), QuickBASIC 4.xx [QB]. These library routines
are intended for use by individuals with some QB programming
experience. The following files make up the Q4Tool Library.
Primary: Q4T.LIB - Q4T.QLB - Q4T.BI - Q4TOOL.DOC
Support: Q4T-DEMO.BAS - Q4T-DEMO.EXE - SHOWMENU.OBJ
Q4Tool [Q4T] has emerged from a necessity for a simple
collection of comprehensive routines to supplement the BASIC
language. All of its routines are easily incorporated into
almost any QuickBASIC 4.xx source without greatly increasing
the efficient size of the "stand-alone" program. The Q4Tool
Library is intended as a solid foundation from which to
build your own personal libraries.
** What the Q4Tool Library provides **
============================================
Mouse Services: Mouse*()
A majority of the routines in Q4T pertain to mouse
functions. These functions will allow a programmer to
incorporate the much needed mouse services into any de-
manding application. They are intelligently written to
compensate for a few idiosyncrasies that tend to emerge from
the mouse interrupt (33H).
Windowing: DoWindow()
Windowing for todays applications is not new, but this
windowing routine adds a few features that will enhance any
program. The screen write for this routine is serviced by
machine code for a fast and clean appearance. Select-
ability for title location, type and location of shadow, and
a solid frame, make this windowing routine unique from other
we have seen.
Screen save/restore: PutScrn()/GetScrn()
The ability to save and later restore a screens contents are
essential for contemporary programming. These two routines
are designed to work within the QB environment. They make
use of QB's string descriptor block for ease of use. This
pair of routines is written entirely of machine code for
instant results.
Screen print: PrtScrn()
This is a little machine code routine that will print to the
screen, at the location and color desired, any string vari-
able. It's fast, compact, and incorporates into just one
CALL, QB's LOCATE, COLOR, and PRINT statements. This
routine is the heart of the windowing procedure and the
reason for its speed.
Screen string centering: Ctr()
This is a handy little function that returns the column
position needed to center string data or variables on the
screen. It can easily be incorporated into QB's LOCATE
statement. [i.e., LOCATE 12, Ctr(strg$)]
Program delays: Delay()
This is a smart replacement for QB's new SLEEP statement
(which, by the way, takes over 2K of executable code). The
delay can either be forced or user bypassed with any
key or mouse button.
Access to system interrupts: QB.QLB/QB.LIB/QB.BI (C)
Incorporated within this library are QuickBASIC's QB.QLB
(C), QB.LIB (C) and QB.BI (C). These files were necessary
for writing the mouse routines. Because of their presence,
you also have access to DOS service calls. This is a
powerful feature for any programmer.
** What the Q4Tool Library does not provide **
====================================================
Q4Tool does not contain routines for data input or manip-
ulation. It is felt these type of procedures should be
handled by the programmer for their particular application
needs. Absent also from this library is the abundance of
routines that can't possibly be incorporated into every
program. Q4T is intended to be a small library from which
to build from.
** The nuts and bolts of the Q4Tool Library **
====================================================
The following is a clarified description of the prototypes
used in the CALL's to these Q4Tool library routines. Please
note the variable types used for the arguments in these
routines. The mouse service calls are designed to work with
a Microsoft (R) mouse driver or close compatible.
-------------------
MouseStatus(Ready%)
-------------------
This routine does a nondestructive interrupt vector check to
determine the existence of a mouse driver. This routine
should be called prior to using any of the other Q4T mouse
routines to insure the presence of the mouse interrupt
(33H).
Passed: An integer variable
Returns: 0 if a mouse driver is not detected
1 if a mouse driver has been installed
Example: CALL MouseStatus(have%)
----------------
MouseReset(Set%)
----------------
This routine will initialize the mouse driver and will allow
the saving and restoring of two separate mouse states.
Passed: An initialized integer variable or constant
0 = hard reset - initializes mouse driver, turns
mouse pointer off and disables any prior
user installed events (function 00H)
1 = soft reset - reset mouse driver and turns
pointer off (function 21H)
2 = will save the current mouse state to mouse
buffer #1
3 = will restore the mouse state as saved in mouse
buffer #1
4 = will save the current mouse state to mouse
buffer #2
5 = will restore the mouse state as saved in mouse
buffer #2
Returns: If passed a variable initialized to 0, will reset
mouse and return number of buttons installed, else
returns nothing
Example: buttons% = 0
CALL MouseReset(buttons%)
----------------------
MouseVersion(Version$)
----------------------
This routine will return both the major and minor version of
the mouse driver installed.
Passed: A string variable at lease 5 characters in length
Returns: A string containing the version of the mouse
driver installed. (i.e., 6.123)
Example: CALL MouseVersion(ver$)
---------------------
MouseVisible(Status%)
---------------------
This routine will allow the mouse pointer to be either
turned on or off. This routine has been stabilized by an
internal variable